import * as allStores from '../stores';
import * as odocUtil from '../util/odocUtil';
import { affirmDeleted } from "../util/affirmDeleted";
import { WeaLocaleProvider } from 'ecCom';
const getLabel = WeaLocaleProvider.getLabel;

//接收公文->未签收的topbtns配置
export const receiveDocTopBtnConfigs1 = [
	{
		buttonType: 'primary',
		compStore: allStores.receiveDoc,
		tableStore: allStores.receiveDoc.tableStore,
		onClick: () => {
			odocUtil.onreceiveDocBtnClick(allStores.receiveDoc)
		},
		buttonText: getLabel('18526', '接收'),
	},
	{
		buttonType: 'primary',
		compStore: allStores.receiveDoc,
		tableStore: allStores.receiveDoc.tableStore,
		onClick: () => {
			odocUtil.onSigninDocBtnClick(allStores.receiveDoc, "1")
		},
		buttonText: getLabel('387687', '批量签收'),
	},
	{
		buttonType: 'primary',
		compStore: allStores.receiveDoc,
		tableStore: allStores.receiveDoc.tableStore,
		onClick: () => {
			allStores.receiveDoc.ifShowRejectForm = true;
		},
		buttonText: getLabel('387688', '批量拒收'),
	},
	{
		buttonType: 'primary',
		compStore: allStores.receiveDoc,
		tableStore: allStores.receiveDoc.tableStore,
		onClick: () => {
			allStores.receiveDoc.ifSendBackForm = true;
		},
		buttonText: getLabel('83423', '批量退回'),
	},
];

//接收公文->已签收的topbtns配置
export const receiveDocTopBtnConfigs2 = [
	{
		buttonType: 'primary',
		compStore: allStores.receiveDoc,
		tableStore: allStores.receiveDoc.tableStore,
		onClick: () => odocUtil.onreceiveDocBtnClick(allStores.receiveDoc),
		buttonText: getLabel('18526', '接收'),
	},
	{
		buttonType: 'primary',
		compStore: allStores.receiveDoc,
		tableStore: allStores.receiveDoc.tableStore,
		onClick: () => allStores.receiveDoc.showCreatFlow = true,
		buttonText: getLabel('23087', '创建流程'),
	},
];

//接收公文->已签收或已退回的topbtns配置
export const receiveDocTopBtnConfigs3or4 = [
	{
		buttonType: 'primary',
		compStore: allStores.receiveDoc,
		tableStore: allStores.receiveDoc.tableStore,
		onClick: () => {
			odocUtil.onreceiveDocBtnClick(allStores.receiveDoc)
		},
		buttonText: getLabel('18526', '接收'),
	},

];

//收文登记
export const receiveDocTopBtnConfigs5 = [
	{
		buttonType: 'primary',
		compStore: allStores.receiveDoc,
		tableStore: allStores.receiveDoc.tableStore,
		onClick: () => {
			odocUtil.eleRegist(allStores.receiveDoc)
		},
		buttonText: getLabel('510164', '来文登记'),
	},
	{
		buttonType: 'primary',
		compStore: allStores.receiveDoc,
		tableStore: allStores.receiveDoc.tableStore,
		onClick: () => affirmDeleted(() => odocUtil.batchDeleteList(allStores.receiveDoc)),
		buttonText: getLabel('32136', '批量删除'),
	},
];
//发送公文->待发送的topbtns配置
export const sendDocTopBtnConfigs1 = [
	{
		buttonType: 'primary',
		compStore: allStores.sendDoc,
		tableStore: allStores.sendDoc.tableStore,
		onClick: () => {
			odocUtil.onsendDocBtnClick(allStores.sendDoc, allStores.sendDoc.tableStore)
		},
		buttonText: getLabel('517319', '批量发送'),
	},

];